package org.demo.honor.integration.stock;

import org.demo.honor.integration.dto.LockMobileStockDTO;
import org.demo.honor.integration.dto.MobileTypeDTO;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name = "stock-management", url = "${integration.feign.stock-management}")
public interface StockManagementFeignClient {

    @GetMapping("/api/stock/type/mobile")
    @Cacheable("mobileType")
    List<MobileTypeDTO> retrieveMobileTypeList();

    @PutMapping("/api/stock/lock")
    LockMobileStockDTO lockMobileStock(@RequestParam("mobileType") String mobileType);

    @PutMapping("/api/stock/deduct")
    void deductStock(@RequestBody List<String> imeis);


}
